package test.column
{
	import com.fit4as.fit.ColumnFixture;
	import com.fit4as.fit.Exception;
	
	public class TestColumnFixture extends ColumnFixture
	{
		
		public static var recordedSetterCalls : Array = new Array();
		public static var recordedMethodCalls : Array = new Array();
		
		private var _property : String;
		
		public var stringProperty : String;
		public var intProperty : int;
		public var numberProperty : Number;
		public var booleanProperty : Boolean;
		public var arrayProperty : Array;
		public var customObjectProperty : CustomObject;
		
		public function get property() : String 
		{
			return _property;
		}
		
		public function set property( value : String ) : void
		{
			_property = value;
			recordedSetterCalls.push({ name : "set property", value : value });
		}

		private var _secondProperty : String;
		
		public function get secondProperty() : String 
		{
			return _secondProperty;
		}
		
		public function set secondProperty( value : String ) : void
		{
			_secondProperty = value;
			recordedSetterCalls.push({ name : "set secondProperty", value : value });
		}
		
		public function method() : String
		{
			recordedMethodCalls.push( "method" );	
			return "expectedResult";
		}
		
		override public function parse( s : String, type : Class ) : Object
		{
			trace("TestColumnFixture#parse " + [ s, type ] );
			switch( type )
			{
				case CustomObject : return new CustomObject( s );
			}	
			return super.parse( s, type ); 
		}
		
		override public function getComponentType( name : String ) : Class
		{
			switch( name )
			{
				case "arrayProperty" : return int;	
			}
			throw new Exception("Unexpected name: " + name );
		}
	}
}